package remotecontrolcase.command.light;

import remotecontrolcase.command.Command;
import remotecontrolcase.component.Light;

/**
 * description:
 *  关闭点灯命令类
 * @author yuanmenglv on 2019/11/30
 */
public class LightOffCommand implements Command {
    private Light light;

    public LightOffCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.off();
    }

    @Override
    public void undo() {
        System.out.println("撤销执行");
        light.on();
    }
}
